home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 565 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.4 KB

  1. Path: cs.uwa.edu.au!jasonb
  2. From: jasonb@cs.uwa.edu.au (Jason S Birch)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: PPC compilers
  5. Date: 9 Jan 96 08:49:36 GMT
  6. Organization: The University of Western Australia
  7. Message-ID: <jasonb.821177376@cs.uwa.edu.au>
  8. References: <4com6v$415@maureen.teleport.com> <jasonb.821098303@cs.uwa.edu.au> <volker.0e58@vb.franken.de>
  9. NNTP-Posting-Host: decadence.cs.uwa.oz.au
  10. X-Newsreader: NN version 6.5.0 #3 (NOV)
  11.  
  12. volker@vb.franken.de (Volker Barthelmann) writes:
  13.  
  14. >Jason S Birch (jasonb@cs.uwa.edu.au) wrote:
  15. >: However, once done, he can then safely create variables of that type
  16. >: (the abstract one he's defined, which happens to be the right size) and
  17. >: safely assign appropriate values to them, without having to worry if
  18. >: the eventual assignments are implemented as a .c, .w, or .l. He can
  19.  
  20. >In many cases, but not in all cases. It might e.g. be impossible to declare
  21. >certain hardware registers precise enough in a HLL. So the programmer has to
  22. >know its representation and has to do it by hand.
  23.  
  24. How about bitfields? They can hide information about what particular
  25. bits are used for, and their order in the structure.
  26.  
  27. >: The question is not about whether you need to know if a variable is a
  28. >: float or a long, since they are "abstract" types (and can be different
  29. >: sizes on different machines). The question is whether you need to know
  30. >: how many bits are in each, and what each bit means. In assembler, you
  31. >: do need to know the former, and occasionally the latter.
  32.  
  33. >You sometimes need to know it in HLLs, too. Numerical calculations almost
  34. >always need very detailed information on the data types. Just have a look
  35. >at a C compiler's float.h.
  36.  
  37. I wouldn't say "almost always" - in any case, by using the #defined
  38. labels, you are *still* portable and hiding the implementation details
  39. from yourself.
  40.  
  41. >In many cases You can forget such things after the declaration, but there
  42. >are lots of other cases, too.
  43.  
  44. Perhaps, but I'll wager they're extremely rare - with assembler, which
  45. is what the discussion was about, you constantly need to remind
  46. yourself of those implementation details, and consistently get it
  47. right.
  48.  
  49. >Volker
  50.  
  51. -- 
  52. Jason S Birch                        ,-_|\ email: jasonb@cs.uwa.edu.au
  53. Department of Computer Science      /     \ Tel (work): +61 9 380 1840
  54. The University of Western Australia *_.-._/ Fax (work): +61 9 380 1089
  55. Nedlands  W. Australia  6907             v  Tel (home): +61 9 386 8630
  56.